<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *订单管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$tabs=array(
    array('op'=>'list','title'=>'全部获奖明细'),
);
if($_RQ['op']=='list'){
    $return['params']=array();
    $params=array('uniacid'=>$_SESSION['uniacid'],'plugin'=>'jy_manghe');
    if($_RQ['type']){
        $params['type']=intval($_RQ['type']);
        $return['params']['type']=intval($_RQ['type']);
    }
    if(isset($_RQ['mid'])){
        $params['mid']=intval($_RQ['mid']);
        $return['params']['mid']=intval($_RQ['mid']);
    }
    $pindex = max(1, intval($_RQ['page']));
    $psize = 10;
    $list=pdo_getslice('core_credit_log',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
    if($list){
        foreach($list as $k=>&$item){
            $item['member']=cfc('core')->member_show($item['mid']);
        }
    }
    $return['list']=$list;
    $totalpage=ceil($total/$psize);
    $totalpage=intval($totalpage);
    $return['totalpage'] =$totalpage;
    $return['params']['page'] =$pindex;
    $htmls=array(
        'type'=>'list',
        'tabs'=>$tabs,
        'list'=>array('data'=>'list','edit'=>false,'del_one'=>false,'delall'=>false,'list'=>array(
            array('name'=>'member','title'=>'会员信息_Member','type'=>'member'),
            array('name'=>'remark','title'=>'内容','type'=>'string'),
            array('name'=>'fee','title'=>'数量','type'=>'string'),
            array('name'=>'type','title'=>'获奖类型','type'=>'radio','options'=>'credit_types'),
            array('name'=>'createtime','title'=>'时间','type'=>'time'),
        )),
        'search'=>array(
            array('type'=>'radio','width'=>15,'name'=>'type','options'=>'credit_types','title'=>'获奖类型'),
            array('type'=>'choose','width'=>15,'action'=>'core/member.get_member/','name'=>'mid','title'=>'选择会员'),
        ),
    );
    $credit_types=credit_types(true);
    $return['statuss']=$this->log_status;
    $return['credit_types']=$credit_types;
    $return['htmls']=$htmls;
    exi($return);
}
